Repository navigation
Conversation
The previous implementation of `mul!` had several problems:
- No combination of `FM * FM` was well-supported: some combinations
errored, and the rest fell through to generic `mul!` methods that were
not optimized for `FactoredMatrix`.
- The errors were `error("not defined")`, which is worse than a
`MethodError`.
- Some arguments were bizarrely typed as `::Array{T,N}` which was both
too specific (why restrict to `Array`?) and too general (why allow any
`N`?).
This refactors the design of `mul!` to support all combinations of `FM`
and `AbstractMatrix` while also:
- supporting any `AbstractMatrix` type for the `U` and `V` fields of
`FactoredMatrix`
- adding new methods of `Workspace` and enhancing its documentation
- renaming the fields of `Workspace` to be more memorable
Claude wrote the tests but wasn't useful for the implementation, which
required careful attention to dispatch ambiguity.
timholy
added a commit
that referenced
this pull request
Apr 28, 2026
Formerly `getindex` was supported for `Adjoint{FactoredMatrix}` and
`Transpose{FactoredMatrix}`, but not `FactoredMatrix` itself. Since
`getindex` should not be supported by `Factorization` objects, just
delete these methods. This is a breaking change, so the version
is bumped to 1.0.0.
Also makes the lowercase `adjoint(A)` and `transpose(A)` return
`FactoredMatrix` objects. This was made possible by #9 which generalized
the types for `U` and `V`. Note the uppercase `Adjoint` and `Transpose`
type-wrappers still return the expected types.
* Bump to v1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous implementation of
mul!had several problems:FM * FMwas well-supported: some combinations errored, and the rest fell through to genericmul!methods that were not optimized forFactoredMatrix.error("not defined"), which is worse than aMethodError.::Array{T,N}which was both too specific (why restrict toArray?) and too general (why allow anyN?).This refactors the design of
mul!to support all combinations ofFMandAbstractMatrixwhile also:AbstractMatrixtype for theUandVfields ofFactoredMatrixWorkspaceand enhancing its documentationWorkspaceto be more memorableClaude wrote the tests but wasn't useful for the implementation, which required careful attention to dispatch ambiguity.